Repository navigation
fix(css): scope pseudo-only selectors, nesting, and deep functions - #82
Merged
Merged
Conversation
- Scope pseudo-only compounds (`:hover`, `:is()`, `:where()`, `:not()`, `:has()`, `::before`, `::slotted()`), including leading compounds. - Recurse into rule blocks and re-parse `Raw` nested rules so explicit (`&`) and implicit CSS nesting is scoped, including inside at-rules. - Scope the `||` column combinator by splitting and scoping the Raw prelude parts. - Support the `:deep()` / `:v-deep()` function form. - Keep `:root` / `:scope` global, since the root element never receives the scope attribute. - Move all previously documented gaps into the supported matrix. Co-Authored-By: Claude <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 25, 2026
## [1.2.7](v1.2.6...v1.2.7) (2026-10-25) ### Bug Fixes * **css:** scope pseudo-only selectors, nesting, and deep functions ([#82](#82)) ([2fccfdd](2fccfdd))
|
🎉 This PR is included in version 1.2.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #81 (the CSS feature-support matrix). This PR fixes the gaps documented there and moves every
it.failingcase into supported assertions.Fixes
:hover→:hover[hash]:is()/:where()/:not()/:has()→…[hash]::before/::slotted()→[hash]::before(prepended, since an attribute cannot follow a pseudo-element):hover > .b,:is(.a) .b,:not(.a) ~ .b,:where(.a) .b).&rules are found by recursing into rule blocksRawby css-tree, so each raw nested rule is re-parsed, scoped, and written back||: css-tree serializes the prelude asRaw; it is now split on top-level||, each part is scoped, and the parts are re-joined.:deep()/:v-deep()function form is supported. A single argument is spliced in place; selector-list arguments become:is(...)with the same matching semantics.Behaviour notes
:rootand:scoperemain global. The root element never receives the scope attribute, so:root[hash]would only turn working rules into dead ones. Descendant subjects are still scoped (:root .b→:root .b[hash]).&itself does not receive a second attribute — the parent rule is already scoped.Tests
src/css/css-features.spec.tsnow contains 126 supported cases, up from 92 supported + 19it.failinggaps.Verification:
🤖 Generated with Claude Code